package bairui.international.console.web.controller.barter.category.product;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.model.domain.jpa.TB_Product;
import bairui.international.service.Service_Product;

/**
 *
 * 产品详情编辑
 *
 * @generated
 * 
 * @see STest_C_Barter_Category_ProductDetailEdit_Edit 测试
 *
 */
@Controller
public class C_Barter_Category_ProductDetailEdit_Edit
 extends SC_Barter_Category_ProductDetailEdit_Edit 
{
	
	@Autowired private Service_Product service_Product;
	
	/**
	 * 编辑
	 */
	@Action(Edit.class)
	@PutMapping(Edit.RequestMappingValue)
	public @FomatOutput @ResponseBody Object edit(
		@Valid Edit.InputModel input, 
		@PathVariable(name=Edit.PathVariableName.CategoryId) long categoryId, 
		@PathVariable(name=Edit.PathVariableName.Id) long id
	) throws Exception {
		TB_Product bean = service_Product.updateWithNonNullProperties(id, input);
		//
		return bean.getId();
	}
	

}
